<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title>-政府采购信息网</title>
    <meta name="description" content="描述">
    <meta name="keywords" content="关键词">
    <link rel="icon" href="/web/img/favicon.ico">
    <link rel="shortcut icon" href="/web/img/favicon.ico">
    <!--    <link rel="stylesheet" href="//at.alicdn.com/t/font_2052942_xzk2q3ix0w.css">-->
    <link rel="stylesheet/less" href="/web/css/tag-list.less">
    <script src="/web/lib/less.min.js"></script>
    <script src="/web/lib/jquery-1.12.4.min.js"></script>
    <script src="/web/public/public.js"></script>
    <script src="/web/lib/jquery.pagination.js"></script>
</head>
<body>
<div class="container">
    <!--这里引入header-->
    <!--#include virtual="/web/html/header/header.htm"-->
    <div id="main">
        <div class="left">
            <h2 class="position">
                <a href="${domain}" target="_blank">首页</a> -> <span>亚利聊政采</span>
            </h2>
            <ul class="content-list"></ul>
            <div class="list-pagination"></div>
        </div>
        <div class="right">
            <!-- 视频课堂 -->
            <!--#include virtual="/web/html/fragment/public/video-classroom.htm"-->
            <!-- 亚利聊政采 -->
            <!--#include virtual="/web/html/fragment/public/audio-column.htm"-->

            <!-- 热点专题 -->
            <!--#include virtual="/web/html/fragment/home/right-boutique.htm"-->
            <!-- 热点排行 -->
            <!--#include virtual="/web/html/fragment/home/right-hot-search.htm"-->
            <!-- 热点排行 -->
            <!--#include virtual="/web/html/fragment/home/ad-list-one.htm"-->
            <!--#include virtual="/web/html/fragment/home/ad-list-two.htm"-->
        </div>
    </div>
    <!--#include file="/web/html/footer/footer.htm"-->
</div>
<script>
    $.ajax({
        url:ports.getTagListTdk,
        data: {
            plateIds: 101
        },
        success:function (res) {
            console.log('获取标签列表tdk',res);
            $("title").text(res.data.channelTitle+'-政府采购信息网'||'政府采购信息网');
            $("meta[name='keywords']").prop('content',res.data.channelKeyword||'');
            $("meta[name='description']").prop('content',res.data.channelDescriptions||'');
        }
    })
    function getTagList(pageNum,resetPage){
        var pageSize = 12;
        $.ajax({
            url: ports.front_article_audio_list,
            data: {

                page:pageNum,
                size:pageSize
            },
            success:function(res) {
                console.log('获取标签列表',res);
                if(res.status==200){
                    var tagListHtml = '';
                    var tagList = res.data.list;
                    if(tagList&&tagList.length){
                        tagList.forEach(function (item) {
                            var keywordsListHtml = '';
                            item.articleKeywords.forEach(function (item1) {
                                keywordsListHtml += '<a href='+ '/web/tagList/1.html?tag='+item1.label+' class="tag">'+ item1.label +'</a>'
                            })
                            tagListHtml += '<li>\n' +
                                (item.articleImage ? '<div class="left">'+'<a target="_blank" href="' + (item.articleOutLinkStatus==0?item.articleUrl:item.articleOutLink) + '">' + '<img src=' + item.articleImage + ' alt=' + item.articleTitle + '></a></div>' : '')
                                +
                                '                    <div class="right">\n' +
                                '                        <div class="title"><a target="_blank" href="'+ (item.articleOutLinkStatus==0?item.articleUrl:item.articleOutLink) +'">'+ item.articleTitle +'</a></div>\n' +
                                '                        <p></p>\n' +
                                '                        <div class="info">\n' +
                                '                            <i class="iconfont icon-shijian"></i><span>'+ item.articleReleaseTime.substr(0,10) +'</span>\n' +
                                '\n'
                                + keywordsListHtml +
                                '                        </div>\n' +
                                '                    </div>\n' +
                                '                </li>'
                        })
                    }else{
                        tagListHtml = '<li class="no-data">暂无数据</li>';
                        $('.list-pagination').remove();
                    }

                    $('ul.content-list').html(tagListHtml);
                    if(resetPage){
                        $('.list-pagination').pagination({
                            prevContent: '< 上一页',
                            nextContent: '下一页 >',
                            totalData: res.data.total||1,
                            showData: pageSize,
                            coping: true,
                            callback: function (api) {
                                console.log(api.getCurrent());
                                var current = api.getCurrent();
                                document.body.scrollTop = 0;
                                document.documentElement.scrollTop = 0;
                                getTagList(current,false);
                            }
                        });
                    }
                }
            }
        });
    }

    getTagList(1,true);

</script>
</body>
</html>
